let data = document.getElementById("data")
function timer() {
    let date = new Date();
    let hh = date.getHours();
    let mm = date.getMinutes();
    let ss = date.getSeconds();
    hh = hh < 10 ? '0' + hh : hh
    mm = mm < 10 ? '0' + mm : mm
    ss = ss < 10 ? '0' + ss : ss
    return hh + ':' + mm
}
data.innerHTML = timer()
// 判断手机还是电脑登录
Isphone()
function Isphone() {
    let info = navigator.userAgent
    let Isphone
    if (Isphone = /mobile/i.test(info)) {
        console.log(Isphone);
    } else {
        alert("请用手机打开哦！")
        location.href = 'https://watch-with-tenderness.gitee.io/'
    }
}
// 绑定点击事件
// 绑定好 当前页面  红包页面 和 点击事件
let all = document.querySelector(".all")
let hideback = document.querySelector('.hideback')
let kai = document.querySelector(".click")
kai.addEventListener('click', function () {
    kai.className = 'click2'
    // 隐藏当前页面 显示出红包页面
    setInterval(() => {
        all.style.display = 'none'
        hideback.style.display = 'block'
    }, 1000);

})
